package com.cn;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.remoting.caucho.HessianServiceExporter;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.cn.sys.service.SysRoleService;

/**
 * @ClassName: Application
 * @Description: TODO
 * @author Administrator
 * @date 2017年6月13日
 */


@MapperScan("com.cn.dao")
@SpringBootApplication
//@ImportResource({"classpath:dubbo.xml"})
@EnableTransactionManagement
public class Application  {
	@Autowired
	private SysRoleService roleService;
	
	public static void main(String[] args) {
		SpringApplication.run(Application.class);
	}
	
	@Bean(name = "/SysRoleService")
	public HessianServiceExporter accountService() {
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(roleService);
		exporter.setServiceInterface(SysRoleService.class);
		return exporter;
	}

}
